package StudyCode.summary.mycollection;

import java.util.List;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class EqualsLists {
	public static <T> boolean equalsLists(List list1, List list2) {
		if (list1.size() != list2.size()) {
			return false;
		}

		for (int i = 0; i < list1.size(); ++i) {
			if (!equals(list1.get(i), list2.get(i))) {
				return false;
			}
		}

		return true;
	}

	public static boolean equals(Object a, Object b) {
		if (a == null) {
			return b == null;
		}

		return a.equals(b);
	}
}
